package com.ncloud.crm.mapper;

import org.apache.ibatis.annotations.*;

import com.ncloud.crm.entity.order.OrderAccount;

import java.util.List;

/**
 * Created by shiqiang on 2017/4/11.
 */
@Mapper
public interface OrderAccountMapper {
    @Select(value = { "select * from bs_o_account where order_id = #{orderId}" })
    @Results({ @Result(column = "order_id", property = "orderId"), @Result(column = "cust_id", property = "custId"),
            @Result(column = "modify_tag", property = "modifyTag"),@Result(column = "acct_id", property = "acctId"),
            @Result(column="create_time",property="createTime"),@Result(column="create_user",property="createUser"),
            @Result(column="update_time",property="updateTime"),@Result(column="update_user",property="updateUser"),
            @Result(column="destroy_time",property="destroyTime"),@Result(column="remark",property="remark"),
            @Result(column="acct_name",property="acctName")
    })
    public List<OrderAccount> getAccountByOrderId(Long orderId);
    @Insert(value = "insert into bs_o_account(order_id,cust_id,modify_tag,acct_id,acct_name,create_time,create_user,update_time,update_user,destroy_time,remark) " +
            "values(#{orderId},#{custId},#{modifyTag},#{acctId},#{acctName},#{createTime},#{createUser},#{updateTime},#{updateUser},#{destroyTime},#{remark})")
    public int insertOrderAccount(OrderAccount orderCustomer);
}
